Skip to content

Introduce %S modifier and use it #13168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Introduce %S modifier and use it #13168

merged 1 commit into from
Jan 16, 2024

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Jan 16, 2024

As suggested in #13153 (comment)

@@ -371,6 +371,15 @@ static void xbuf_format_converter(void *xbuf, bool is_char, const char *fmt, va_
}
break;
}
case 'S': {
zend_string *str = va_arg(ap, zend_string*);
Copy link
Member Author

@nielsdos nielsdos Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could in principle use goto, after fetching the zend_string, to a part of the 'Z' case, but idk I didn't want to impede readability as we don't typically use goto unless in error situations.

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙂 I wished this was there in the past as well.

@nielsdos nielsdos merged commit 8d5c3e6 into php:master Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants